# -*- coding: utf-8 -*-


from UI.CrkPublic2 import CRKPublic,Common

InputData = Common.InputData
UIExcept = Common.UIExpect
InputElement = Common.dealXlsElement(Common.elementPathTwo)

class BasePage(CRKPublic):

    def Task_Agents(self,tab_2):
        '''
        点击代办后，选择首条记录进入操作
        '''
        self.getMenu(InputData.get('Task_agents'), InputElement.get('Task_agents'))                       # 进入待办
        self.msgCheckElement('待办(签)任务', InputElement.get('tab_1_name'))                      # 校验tab页是否打开
        self.click(InputElement.get('Task_agents_one'), '待办签任务首条记录')                          # 选择首条记录
        self.msgCheckElement(tab_2.format(InputData.get('corporate_name')),
                        InputElement.get('tab_2_name'))                                      # 校验tab页是否打开


    def Submit(self,logs):
        '''
        提交按钮
        :param logs: 打印日志
        :return:
        '''
        self.click(self.reMatch(InputElement.get('submit_matching')), logs)

    def Return(self,logs):
        '''
        退回按钮
        :param logs: 打印日志
        :return:
        '''
        self.click(self.reMatch(InputElement.get('Return_matching')), logs)

if __name__ =='__main__':
    BasePage()
